package com.study.servlet;

import com.study.dao.CustomerDao;
import com.study.dao.impl.CustomerDaoImpl;
import com.study.model.Customer;
import com.study.util.GsonHelper;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;

/**
 * @author WS
 */
@WebServlet(name = "logoutServlet",urlPatterns = "/logoutServlet")
public class LogoutServlet extends BaseServlet {
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        doPost(req, resp);
    }

    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        super.doPost(req,resp);
        req.getSession().removeAttribute("CURRENTCUS");
        resp.sendRedirect(req.getContextPath()+"/login.jsp");
    }
}
